<template>
	<view class="information">
		<view :class="['information_item', type == 2 ? 'recerve' : '']" v-for="(item, index) in dataList" :key="index" @click="openDetail(item)">
			<image class="information_img" :src="item.logo" mode="aspectFill"></image>
			<view class="information_cont">
				<view class="u-line-2">{{ item.name }}</view>
				<view class="u-font-23 u-m-t-5 u-line-1">{{ item.title || '' }}</view>
				<view class="readTime">
					<view class="u-m-r-20">{{ item.date_creation | formatTime }}</view>
					<view class="">{{ item.view }} 阅读</view>
				</view>
			</view>
		</view>
		<sww-load-more :params="{ ...dataListParams, emptyText: type == 1 ? '主办方暂未添加贵宾' : '该活动暂无活动展商' }"></sww-load-more>
	</view>
</template>

<script>
import { pagingMixin } from '@/mixins/pagingMixin.js';
import { formatDate } from '@/utils/moment/index.js';
export default {
	mixins: [pagingMixin],
	props: {
		meetId: {
			type: Number,
			default: 0
		},
		type: {
			type: Number,
			default: 1
		}
	},
	filters: {
		formatTime(time) {
			return formatDate(time, 'YYYY-MM-DD');
		}
	},
	components: {},
	data() {
		return {
			searchName: ''
		};
	},
	mounted() {},

	methods: {
		init() {
			if (!this.dataListParams.init) {
				this.initList();
			}
		},
		initList() {
			this._init_data('GetMeetingHonouredGuest', { name: this.searchName, type: this.type, pk_id: this.meetId });
		},
		$onPullDownRefresh() {
			this.initList();
		},
		$onReachBottom() {
			this._load_data();
		},
		openDetail(item) {
			this.$linkTo(`/package/meet/guestDetail/index?id=${item.pk_id}`);
		}
	}
};
</script>

<style scoped lang="scss">
.information {
	padding: 10rpx 26rpx;
	background-color: #fff;
	min-height: 100vh;

	.information_item {
		display: flex;
		justify-content: space-between;
		border-bottom: 1rpx solid #f5f5f5;
		padding: 30rpx 0;
		&.recerve {
			flex-direction: row-reverse;
			.information_img {
				margin: 0 0 0 16rpx;
			}
		}
		.information_cont {
			display: flex;
			flex: 1;
			flex-direction: column;
			justify-content: space-between;
		}

		.information_img {
			width: 220rpx;
			height: 140rpx;
			border-radius: 15rpx;
			margin-right: 16rpx;
		}
		.information-item-zfx {
			width: 180rpx;
			height: 180rpx;
			border-radius: 15rpx;
		}

		.readTime {
			display: flex;
			justify-content: space-between;
			color: #999;
		}

		.guest {
			margin: 10rpx 0;
		}
	}
}
</style>
